package com.chengcang.api.modules.sys.controller;

import com.chengcang.api.modules.sys.entity.DictType;
import com.chengcang.api.modules.sys.service.SysDictTypeService;
import com.chengcang.common.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author fankunfeng
 * @date 2023-02-13 10:26:47
 **/
@RestController
@RequestMapping("sys/dict/type")
@Api(tags="字典类型")
@RequiredArgsConstructor
public class SysDictDataController {

    private final SysDictTypeService sysDictTypeService;

    @GetMapping("all")
    @ApiOperation("所有字典数据")
    public Result<List<DictType>> all(){
        List<DictType> list = sysDictTypeService.getAllList();

        return new Result<List<DictType>>().ok(list);
    }
}
